package blog.core.util;

import blog.core.exception.DependException;
import blog.core.exception.NotFoundException;

public class ExceptionUtils {

	/**
	 * 新建一个NotFoundException异常
	 *
	 * @param id
	 *            对象编号
	 * @param name
	 *            实体类型名称
	 * @throws NotFoundException
	 *             抛出NotFound异常
	 */
	public static void NewNotFound(int id, String name)
			throws NotFoundException {
		throw new NotFoundException("编号为:" + id + "的" + name + "没有找到!");
	}

	/**
	 * 新建一个DependException异常
	 * @param name 被依赖对象名称
	 * @param dependObjectName 依赖对象名称
	 * @throws NotFoundException
	 */
	public static void NewDepend(String name, String dependObjectName)
			throws DependException {
		throw new DependException("存在依赖" + name + "的" + dependObjectName
				+ ".");
	}
}
